pixelcache: reuse existing timeout source when possible
authorChristian Hergert <christian@hergert.me>
Wed, 27 Apr 2016 02:30:30 +0000 (19:30 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 27 Apr 2016 10:26:42 +0000 (06:26 -0400)
commit0763a027c7f90feb446505f76b2c8d9ded05d6d1
tree3f3d84bb4b889f3da0df02a1c56bea32dfc15d64
parent060c7d5c184c44102d2b2b9249337400af19b56a
pixelcache: reuse existing timeout source when possible

This avoids the g_source_remove(), g_source_destroy(),
g_timer_source_new(), and g_source_set_name_by_id() in the common case.

Instead, we reuse our previous source and update the ready time to our
new deadline. We lose the coalescing with g_timeout_add_seconds(), but
that is not going to help in the common case anyway (unless you have
three hands and can scroll multiple pixelcached backed widgets at once).

https://bugzilla.gnome.org/show_bug.cgi?id=765640
gtk/gtkpixelcache.c